Skip to content

fix(apps/callbacks): use raw app ack bytes in the v2 async receive callback - #9079

Open
kriss39 wants to merge 1 commit into
lfdt-ibc:mainfrom
kriss39:fix/callbacks-v2-async-ack-type
Open

kriss39 wants to merge 1 commit into
lfdt-ibc:mainfrom
kriss39:fix/callbacks-v2-async-ack-type

Conversation

@kriss39

@kriss39 kriss39 commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Description

In the IBC v2 callbacks middleware the destination callback invoked from OnRecvPacket receives a RecvAcknowledgement, so ack.Acknowledgement() returns the raw application acknowledgement bytes. The asynchronous WriteAcknowledgement path wrapped the same bytes in a channeltypesv2.Acknowledgement, whose Acknowledgement() returns the protobuf encoding of the wrapper. A contract therefore observed different acknowledgement bytes for the same packet depending on whether the application acknowledged synchronously or asynchronously.

This PR uses RecvAcknowledgement in the async path too and adds TestWriteAcknowledgementCallbackAckMatchesSyncPath, which records the bytes delivered to the contract keeper on both paths and requires them to be equal (on main it fails with {"result":"AQ=="} vs 0a 11 {"result":"AQ=="}).

closes: #9074


Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Linked to GitHub issue with discussion and accepted design, OR link to spec that describes this work.
  • Include changelog entry when appropriate (e.g. chores should be omitted from changelog).
  • Wrote unit and integration tests if relevant.
  • Updated documentation (docs/) if anything is changed. (n/a — no documented behaviour changes)
  • Added godoc comments if relevant.
  • Self-reviewed Files changed in the GitHub PR explorer.
  • Provide a conventional commit message to follow the repository standards.

@kriss39
kriss39 requested a review from a team as a code owner September 13, 2026 20:48
@greptile-apps

greptile-apps Bot commented Sep 13, 2026

Copy link
Copy Markdown

PR author is not in the allowed authors list.

@kriss39
kriss39 force-pushed the fix/callbacks-v2-async-ack-type branch from 801ecd0 to 12e11d4 Compare September 13, 2026 20:51
@kriss39
kriss39 force-pushed the fix/callbacks-v2-async-ack-type branch from 53d883f to 741ebd8 Compare October 21, 2026 08:54
@codecov

codecov Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 66.84%. Comparing base (501acd1) to head (741ebd8).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9079      +/-   ##
==========================================
+ Coverage   66.83%   66.84%   +0.01%     
==========================================
  Files         329      329              
  Lines       17497    17490       -7     
==========================================
- Hits        11694    11692       -2     
+ Misses       5069     5066       -3     
+ Partials      734      732       -2     
Flag Coverage Δ
08-wasm 65.04% <ø> (ø)
ibc-go 66.90% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kriss39
kriss39 requested a review from a team as a code owner November 15, 2026 21:26
@codecov

codecov Bot commented Nov 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@kriss39
kriss39 force-pushed the fix/callbacks-v2-async-ack-type branch from 166578a to cf17a57 Compare November 29, 2026 08:22
In the IBC v2 callbacks middleware the destination callback invoked from
OnRecvPacket wraps the application acknowledgement in RecvAcknowledgement,
so Acknowledgement() returns the raw application bytes. The asynchronous
WriteAcknowledgement path instead wrapped the same bytes in a
channeltypesv2.Acknowledgement, whose Acknowledgement() returns the
protobuf encoding of the wrapper. A contract therefore observed different
acknowledgement bytes for the same packet depending on whether the
application acknowledged synchronously or asynchronously.

Use RecvAcknowledgement in both paths and add a regression test that
compares the bytes delivered to the contract keeper.

Signed-off-by: Kriss <93033289+kriss39@users.noreply.github.com>
@kriss39
kriss39 force-pushed the fix/callbacks-v2-async-ack-type branch from cf17a57 to 3ec64c3 Compare November 29, 2026 08:25

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

callbacks/v2: async WriteAcknowledgement hands the contract a proto-wrapped acknowledgement, unlike OnRecvPacket

1 participant